#ifndef	__GUIWIDGET_H_
#define	__GUIWIDGET_H_

#include <cstdint>

#include "math.h"
#include "input.h"

struct GuiColor
{
	uint8_t R;
	uint8_t G;
	uint8_t B;
	uint8_t A;
};

class CGuiWidget : public CInputListener
{
	friend class CGuiManager;
	public:
		CGuiWidget();
		~CGuiWidget();

		virtual void Update() = 0;
		virtual void Render() = 0;
		virtual bool IsMouseOver();
		virtual bool WasMouseDownInside();
		virtual bool IsSelectable();
		virtual bool IsMouseDown();

		void SetColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a);

	protected:
		vec2f m_v2f_Pos;
		vec2f m_v2f_Dim;

		GuiColor m_Color;

		std::vector<CGuiWidget*> m_vWindows;

		bool m_bMouseOver;
		bool m_bMouseDown;
		bool m_bDragging;
};

#endif
